<template>
  <div>
    <div class="title">热销推荐</div>
    <div class="item border-bottom" v-for="item in recommendList" :key="item.id">
      <router-link :to='"/detail/"+item.id' tag="div" class="item">
          <img class="item-img" :src="item.imgUrl">
          <div class="item-content">
            <p class="item-title">{{item.title}}</p>
            <p class="item-desc">{{item.desc}}</p>
            <p><button class="item-button" value="查看详情">查看详情</button></p>
          </div>
      </router-link>
    </div>
  </div>
</template>
<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: Array
  },
  data () {
    return {
    }
  }
}
</script>
<style lang="stylus" scoped>
.title
  margin-top: .1rem
  background: #eee
  line-height: .8rem
  text-indent: .2rem
.item
  display: flex
  height 1.9rem
  .item-img
    height 1.7rem
    width 1.7rem
    padding: .1rem
  .item-content
    flex: 1
    min-width: 0
    .item-title
      font-size: .32rem
      line-height: .54rem
      padding: .1rem
      text-overflow: ellipsis
      overflow hidden
      white-space: nowrap
    .item-desc
      color: #ccc
      line-height: .2rem
      padding: .1rem
      text-overflow: ellipsis
      overflow hidden
      white-space: nowrap
    .item-button
      background: #ff9300
      border-radius: .1rem
      padding: 0 .3rem
      color: #fff
      line-height: .44rem
      font-size: .22rem
      margin-top: .22rem
</style>
